import { request } from "@/utils";
// 商品类型接口(API)
export default {
  toggleRole: (data) => request.post("/basic-api/plugin/myPlugin", data),
  AddApi: (data) => request.post("/basic-api/commodity/goods/add", data),
  myPluinApi: (data) => request.post("/basic-api/plugin/myPlugin", data),
  ListApi: (params) =>
    request.get("/basic-api/commodity/goods/list", { params }),
  storeListApi: (params) =>
    request.get("/basic-api/commodity/business/list", { params }),
  categoryListApi: (params) =>
    request.get("/basic-api/commodity/category/list", { params }),
  DeleteApi: (data) => request.post("/basic-api/commodity/goods/delete", data),
  checkPluginApi: (data) => request.post("/basic-api/plugin/checkPlugin", data),
  EditApi: (data) => request.post("/basic-api/commodity/goods/edit", data),
  userPluginApi: (data) => request.post("/basic-api/plugin/userPlugin", data),
  otherUserPluginApi: (data) =>
    request.post("/basic-api/plugin/pluginOtherUserPlugin", data),
  userListApi: (params = {}) =>
    request.get("/basic-api/adminUserList", { params }),
  goodsSkuTemplateAddApi: (data) =>
    request.post("/basic-api/commodity/goods/goodsSkuTemplateAdd", data),
  goodsSkuTemplateListApi: (params = {}) =>
    request.get("/basic-api/commodity/goods/goodsSkuTemplateList", { params }),
  goodsSkuTemplateDetailsApi: (params = {}) =>
    request.get("/basic-api/commodity/goods/goodsSkuTemplateDetails", {
      params,
    }),

  // 商品详情
  goodsDetailsApi: (params = {}) =>
    request.get("/basic-api/commodity/goods/goodsDetails", { params }),
  // 服务保障接口
  goodsServiceGuaranteeListApi: (params = {}) =>
    request.get("/basic-api/otherProgram/goods/goodsServiceGuaranteeList", {
      params,
    }),
  goodsServiceGuaranteeAddApi: (data) =>
    request.post(
      "/basic-api/otherProgram/goods/goodsServiceGuaranteeAdd",
      data,
    ),
  goodsServiceGuaranteeDelApi: (data) =>
    request.post(
      "/basic-api/otherProgram/goods/goodsServiceGuaranteeDel",
      data,
    ),
  goodsServiceGuaranteeEditApi: (data) =>
    request.post(
      "/basic-api/otherProgram/goods/goodsServiceGuaranteeEdit",
      data,
    ),

  toggleRole: (data) => request.post("/auth/role/toggle", data),
  // 选择框接口
  categoryListApi: (params) =>
    request.get("/basic-api/commodity/category/list", { params }),
  typeOptionApi: (params) =>
    request.get("/basic-api/commodity/category/typeOption", { params }),
  typeSetDataApi: (data) =>
    request.post("/basic-api/commodity/category/typeSetData", data),

  // 商品标签
  goodsLabelListApi: (params) =>
    request.get("/basic-api/commodity/goods/goodsLabelList", { params }),
  goodsLabelAddApi: (data) =>
    request.post("/basic-api/commodity/goods/goodsLabelAdd", data),
  goodsLabelDelApi: (data) =>
    request.post("/basic-api/commodity/goods/goodsLabelDel", data),
  goodsLabelEditApi: (data) =>
    request.post("/basic-api/commodity/goods/goodsLabelEdit", data),
  goodsGroupListApi: (params) =>
    request.get("/basic-api/commodity/goods/goodsGroupList", { params }),
  goodsGroupAddApi: (data) =>
    request.post("/basic-api/commodity/goods/goodsGroupAdd", data),
  goodsGroupDelApi: (data) =>
    request.post("/basic-api/commodity/goods/goodsGroupDel", data),
  goodsGroupEditApi: (data) =>
    request.post("/basic-api/commodity/goods/goodsGroupEdit", data),
};
